package jucTest;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class SingleDemo {
    //私有化构造方法
    private SingleDemo(){

    }
    private SingleDemo getSinle(){
        return inner.sigle;
    }
    static class inner{
        private static SingleDemo sigle=new SingleDemo();
    }

    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        Class vo = EnumDemo.class;
        Constructor<EnumDemo> constructor = vo.getDeclaredConstructor(String.class,int.class);
        constructor.setAccessible(true);
        EnumDemo demo=constructor.newInstance();

    }
}
